#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using i128 = __int128;
const int N = 1e6 + 5;

void solve() {
    string s;
    cin >> s;
    stack<char> st;
    for (int i = 0; i < s.length(); i++) {
        if (s[i] == 'a')
            st.push(s[i]);
        else if (s[i] == 'b'){
            if (!st.empty()) {
                st.pop();
            }
            else {
                cout << "Bad" << endl;
                return;
            }
        }
    }
    if(st.empty())cout<<"Good"<<endl;
    else cout<<"Bad"<<endl;
    return;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    solve();

    return 0;
}